package leetcode.code1252;

import leetcode.IDebug;

public class Solution implements IDebug {

	public int oddCells(int m, int n, int[][] indices) {
		int[] r = new int[m];
		int[] c = new int[n];
		for (int i = 0; i < indices.length; i++) {
			r[indices[i][0]] += 1;
			c[indices[i][1]] += 1;
		}
		int oddr = 0;
		for (int i = 0; i < m; i++) {
			oddr += (r[i] & 1) == 1 ? 1 : 0;
		}
		int oddc = 0;
		for (int i = 0; i < n; i++) {
			oddc += (c[i] & 1) == 1 ? 1 : 0;
		}
		return oddr * (n - oddc) + (m - oddr) * oddc;
	}

	@Override
	public void debug4() {
		// TODO Auto-generated method stub

	}

	@Override
	public void debug3() {
		// TODO Auto-generated method stub

	}

	@Override
	public void debug2() {
		// TODO Auto-generated method stub

	}

	@Override
	public void debug1() {
		// TODO Auto-generated method stub

	}

	public static void main(String[] args) {
		Solution so = new Solution();
		so.debug1();
		so.debug2();
		so.debug3();
		so.debug4();

	}

}
